Skip to content

🤖 feat: choose what a settings backup carries - #3985

Open
ibetitsmike wants to merge 7 commits into
mainfrom
mike/backup-mcp-redaction
Open

🤖 feat: choose what a settings backup carries#3985
ibetitsmike wants to merge 7 commits into
mainfrom
mike/backup-mcp-redaction

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

The settings backup now lets the user choose what it carries. Nine checkboxes in the Backup settings form select the categories (global instructions, agent definitions, skills, global memory, portable preferences, MCP server configuration, and under MCP the HTTP header values and stdio commands) alongside the existing project opt-in. The same selection governs export and restore: an unselected category is absent from the published backup and is never written by a restore. Deselected MCP headers or commands become the existing redaction marker, so a restore keeps this machine's values for them.

Background

Backups publish mcp.jsonc, and MCP header values, stdio commands, and URLs commonly hold credentials. The earlier revision of this PR tried to solve that with credential-format detection and shell-grammar redaction of NAME=value assignments. That approach guesses at what is secret, fails closed on shapes it cannot parse, and makes the user rehydrate redacted values on every restore even when they wanted them published. Per review discussion, this PR replaces detection with an explicit choice: the user decides which categories a backup carries, and anything sensitive that is still selected goes through the existing byte-bound secret-scan approval.

Supersedes the redaction approach previously on this PR (old head e6352db362).

Implementation

  • settingsBackup.ts adds optional include* flags next to includeProjects; resolveBackupContents() applies defaults once (all on, projects off as before, which was a deliberate privacy default in 🤖 feat: opt-in project bundle for settings backup #4043). Older config.json files load unchanged.

  • Export: collectAllowlistedFiles and scanBackupFilesForSecrets take the resolved contents, so unselected categories are never read or scanned. redactMcpConfig now receives an McpProjectionOptions (headers and commands on or off) instead of deciding by pattern; deselected fields become __MUX_BACKUP_REDACTED__ and are listed in mcpRedactions.

  • Approval gate: mcpConfigRequiresPublishApproval flags selected stdio commands, credential-bearing URLs, and now literal header values too. A {secret: NAME} reference names a secret without carrying it, so it does not trigger approval. URL credentials are covered by the approval gate only; no detection.

  • Restore: readBackupPayload takes the current machine's selection and skips unselected manifest entries before opening them, so a deselected category is never read or parsed and a malformed file there cannot block a restore of the rest. The selected payload is then projected through selectBackupContents before preview, approval, and restore, so a machine with headers unchecked keeps its own header values whether the backup carries them or omits the field entirely, and unselected local files are no longer reported as local-only.

  • Literal headers from a backup restore verbatim on a fresh machine (a repository editor could already read them). {secret: NAME} references keep the local-only plus endpoint-match rule, since redirecting a secret reference to a different URL would exfiltrate a value the repository never held.

  • UI: the static "Included" card is replaced by the checkbox list inside the settings form. MCP sub-options are indented and disabled when MCP is unchecked, and their shortcuts are inert while the parent is off. Every toggle has a Ctrl+Alt shortcut (listed under Keybinds, hint hidden on mobile widths). The preview's "Kept on this device" card says so when MCP is excluded from the backup entirely.

  • CI: the Codex Comments gate's informational-summary allow-list now accepts a completed status board whose security findings Codex itself marks Resolved (linking to a thread on this PR). This PR's board carries 43 such lines from the earlier revision, so the job failed with zero open findings. Live advisories and unknown headings still block; four fixture rows cover both directions.

Validation

  • Real-repo integration round trip: publish with a literal header after approval, then restore on a second machine root with headers deselected and confirm the local header value survives.
  • UI test covers the save payload for every flag and the MCP parent gating of the two sub-options.

Risks

  • Behavior change relative to main: literal MCP header values are now published verbatim by default, where main always redacted them. Publishing still requires the secret-scan approval (literal headers now trigger it), and unchecking "HTTP header values" gives the previous always-redact result. Stdio commands keep main's behavior (verbatim behind approval) and gain the same opt-out.
  • Restore-time projection rewrites the in-memory mcp.jsonc after readBackupPayload has verified the manifest hashes, so the on-disk checkout is never modified; the manifest file list is filtered in step with the files, and the integration test pins the round trip.

Generated with xum • Model: anthropic:claude-fable-5-1 • Thinking: xhigh • Cost: $1137.63

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbfabe752e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts Outdated
Comment thread src/node/services/backup/payload.ts Outdated
@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c2d5ad4be

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: 7c2d5ad4be

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/node/services/backup/payload.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 543d699c8f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 543d699c8f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts Outdated
@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 875b0c8c82

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts Outdated
@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b9f9f51be0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: b9f9f51be0

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/node/services/backup/payload.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fd948f88e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts Outdated
Comment thread src/node/services/backup/payload.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: 9fd948f88e

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/node/services/backup/payload.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38cdefbd50

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts Outdated
Comment thread src/node/services/backup/payload.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39b3c721eb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts Outdated
Comment thread src/node/services/backup/payload.ts Outdated
Comment thread src/node/services/backup/payload.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f68116c450

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts Outdated
Comment thread src/node/services/backup/payload.ts Outdated
Comment thread src/node/services/backup/payload.ts Outdated
Comment thread src/node/services/backup/payload.ts Outdated
Comment thread src/node/services/backup/payload.ts Outdated
Comment thread src/node/services/backup/payload.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: f68116c450

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/node/services/backup/payload.ts Outdated
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review
Please take another look.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: e6352db362

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: e6352db362

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Replace credential detection in the MCP export with a per-category content
selection saved in settingsBackup (includeInstructions, includeAgents,
includeSkills, includeGlobalMemory, includeMcp, includeMcpHeaders,
includeMcpCommands, includePreferences; includeProjects keeps its opt-in
default). One selection governs both directions: collection and export skip
unselected categories, and a restore only writes selected ones.

MCP header values and stdio commands are published as written when selected,
gated by the existing byte-bound secret-scan approval. When deselected they
become the existing redaction marker, so a restore keeps this machine's values;
the same projection is applied to a checked-out backup at restore time so the
restoring machine's selection wins. Literal headers from a backup now restore
verbatim; {secret: NAME} references keep the local-only endpoint-match rule.

The Backup settings screen replaces the static "Included" list with the
checkbox selection (MCP has two indented sub-options).
@ibetitsmike ibetitsmike changed the title 🤖 fix: redact MCP command env values and credential URLs in settings backup export 🤖 feat: choose what a settings backup carries Sep 10, 2026
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

The PR was rewritten: the credential-detection and shell-grammar redaction approach is replaced by user-selected backup contents (see the updated description). Head is af1bc9f, rebased on current main.

@ibetitsmike
ibetitsmike force-pushed the mike/backup-mcp-redaction branch from e6352db to af1bc9f Compare September 10, 2026 23:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T03:37:20.012160Z 2f1f575 New commits
🔒 Security Review Completed 2026-09-11T03:41:04.222144Z 2f1f575 New commits

Security findings

Advisory findings (43)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af1bc9f976

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/adapters.ts Outdated
Comment thread src/browser/features/Settings/Sections/BackupSection.tsx Outdated
Comment thread src/browser/features/Settings/Sections/BackupSection.tsx Outdated
Comment thread src/common/config/schemas/settingsBackup.ts
Review follow-ups: readBackupPayload skips unselected manifest entries
so a deselected category is never parsed; the preview says when MCP is
excluded; every content toggle has a Ctrl+Alt shortcut.
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

Addressed all four threads on 5bca829 (read only selected categories, MCP-excluded preview copy, shortcuts for every content toggle); the downgrade thread is answered inline with the scope rationale.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 5bca829d27

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 5bca829d27

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

The informational-summary allow-list rejected a completed board that
lists security findings Codex itself marks Resolved, so the Codex
Comments job failed on a PR with no open finding. Accept only that
exact shape (resolved, linking to a thread on this PR); live advisories
and unknown headings still block.
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

New head 2312afa adds one CI-only commit: the Codex Comments gate now accepts a completed status board whose findings are all marked Resolved (this PR's board lists 43 resolved advisories from the earlier revision, which made the job fail with zero open findings). Product code is unchanged from 5bca829.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2312afad94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 2312afad94

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

With a category deselected, the restore-side projection now marks the
field even when the backup entry does not carry it, so the existing
rehydration keeps this machine's value instead of dropping it with the
entry. Exports are unchanged.
@ibetitsmike

Copy link
Copy Markdown
Contributor Author

@codex review

Head 354ed92 fixes the absent-field retention thread: the restore-side projection marks deselected headers/commands the backup entry lacks, so local values survive under the existing endpoint rule. One product commit on top of 2312afa.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 354ed9213e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts Outdated
Comment thread src/node/services/backup/payload.ts
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 354ed9213e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

… markers

parseManifest drops mcpRedactions unread when the selection leaves MCP
alone, so a malformed or oversized list cannot fail a restore of the
other categories. The restore-side projection no longer applies the
publish caps to the markers it adds for absent deselected fields, so a
large valid backup stays restorable when a category is deselected.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef0346acfe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/backup/payload.ts Outdated
Comment thread src/node/services/backup/payload.ts
A backup written when header values were redacted one by one lists
child paths; deselecting headers now replaces the object with one
marker, and the stale child path made the restore reject the manifest.
Keep only listed paths that still name a marker in the projected file.
parseManifest now filters entries by the content selection before the
per-entry checks, so a malformed entry for a category the restore
leaves alone cannot fail it. This replaces the read-loop skip.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f1f575a55

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1778 to 1781
function parseManifest(raw: string, portable: boolean, contents?: BackupContents): BackupManifest {
const tree = jsonc.parseTree(raw);
if (!tree) throw new Error("Invalid backup manifest");
assertNoDuplicateKeys(tree, "backup manifest");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Filter deselected entries before checking duplicate keys

When restoring with a category deselected—for example, includeSkills: false—a corrupt manifest entry for that category containing duplicate sha256 keys still aborts preview and restore. Fresh evidence beyond the resolved invalid-digest case is that assertNoDuplicateKeys recursively walks the entire manifest here before the selection filter at line 1801 runs, even though the deselected file is never read or written. Filter the manifest tree first or restrict duplicate-key validation to retained entries.

AGENTS.md reference: AGENTS.md:L111-L111

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing this one, and leaving the thread open for a human decision rather than resolving it.

Duplicate-key validation is a document-level check that has to run before the selection filter, not after it: the filter classifies each entry by its path key, and an entry with duplicate keys has no single trustworthy path (the JSONC tree carries both values while JSON.parse keeps the last). Filtering first would let a crafted entry present an unselected path to the tree walk and a selected one to the parsed object, so the whole manifest is rejected as malformed before any of it is trusted. The earlier fixes in this series (entries, mcpRedactions, per-file parsing) skip category-specific content whose classification is unambiguous; a manifest that is not a well-formed document is a different thing, and refusing to restore from it is the intended behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant